package multiProocess;

class MyThread implements Runnable {
    private String name;
    private Integer threadCount = 10;

    public MyThread(String name) {
        this.name = name;
    }

    @Override
    public void run() {  // 覆写run()方法，作为线程 的操作主体
        for (int i = 0; i < threadCount; i++) {
            System.out.println(name + "运行，i = " + i);
        }
    }
}

public class RunnableDemo01 {
    public static void main(String[] args) {
        MyThread mt1 = new MyThread("线程A ");
        MyThread mt2 = new MyThread("线程B ");
        Thread t1 = new Thread(mt1);
        Thread t2 = new Thread(mt2);
        t1.start();
        t2.start();
    }
}
